<template>
	<view class="vipgood" @click="gourl()">
		<image :src="good.thumb" class="vipgood_thumb" mode=""></image>
		<view class="vipgood_info">
			<view class="vipgood_info_title">
				{{good.title}}
			</view>
			<view class="vipgood_info_desc">
				{{good.desc}}
			</view>
			<view class="vipgood_info_bottom">
				<view class="vipgood_info_bottom_left">
					<text class="vipgood_info_bottom_left_price"><text style="font-size: 20upx;">￥</text>{{good.price}}</text>
					<text class="vipgood_info_bottom_left_oldprice">￥{{good.oldprice}}</text>
				</view>
				<view class="vipgood_info_bottom_buybtn">
					去购买
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"VipGood",
		data() {
			return {
				
			};
		},
		props: {
			good: {
				type: Object,
				default: function(){
					return {}
				}
			}
		},
		methods:{
			gourl(e){
				uni.navigateTo({
					url:'/pages/goods/detail?id='+this.good.id
				})
			}
		}
	}
</script>

<style lang="scss">
	.vipgood{
		width: 100%;
		min-height: 260upx;
		box-sizing: border-box;
		padding: 20upx;
		background-color: #fff;
		border-radius: 20upx;
		margin-top: 16upx;
		display: flex;
		justify-content: space-between;
		&_thumb{
			width: 260upx;
			height: 260upx;
			background-color: #f5f5f5;
			border-radius: 6upx;
		}
		&_info{
			flex: .95;
			height: fit-content;
			display: flex;
			flex-direction: column;
			&_title{
				width: 100%;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				margin: 10upx 0;
				padding-top: 6upx;
				color: #000;
				font-size: 26upx;
				font-weight: 600;
			}
			&_desc{
				width: 100%;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				margin: 0 0 10upx;
				color: #666;
				font-size: 22upx;
			}
			&_bottom{
				width: 100%;
				display: flex;
				align-items: center;
				justify-content: space-between;
				margin-top: 40upx;
				&_left{
					display: flex;
					flex-direction: column;
					&_price{
						color: red;
						font-weight: 600;
						font-size: 30upx;
					}
					&_oldprice{
						color: #c4c4c4;
						font-size: 24upx;
						text-decoration: line-through;
					}
				}
				&_buybtn{
					width: 120upx;
					line-height: 50upx;
					background: linear-gradient(90deg,#f44336,#e91e63);
					border-radius: 24upx;
					font-size: 24upx;
					font-weight: 500;
					color: #fff;
					text-align: center;
				}
			}
		}
	}
</style>